package com.xian.cloud.listener;

import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Author: xlr
 * @Date: Created in 上午11:39 2018/10/27
 */
@Component
public class HelloReceiver {

    /**
     * 创建queue和自动绑定Exchanges(交换机)上
     * @param hello
     */
    @RabbitListener( bindings=
                        @QueueBinding(
                                value=@Queue("queue"), exchange=@Exchange("exchange")
                        )
    )
    public void process(String hello) {
        System.out.println("Receiver  : " + hello);
    }
}
